#pragma once
#include <string>
#include "Token.h"
#include "SFile.h"

#include <map>
#include "Tag.h"
using namespace std;
// tokens and classes (operators last and in precedence order)
// copied from c4

class SLexer
{
public:
	SLexer();
	SLexer(SFile &file);
	virtual ~SLexer();

	bool GetNextChar();
	bool GetNextChar(char ch);
	void BackChar();
	string GetStrPreChar(char ch);
	string GetStrPreChar(char ch, bool containSpace);
	//virtual void toString();
	map<string,  Token> KeyWord;

	Token Scan();
	int gethex(void);
	int line;
	bool isIdentity(char ch);
	bool isIdentityOrDigit(char ch);
	bool isDigit(char ch);

private:
	SFile *sFile;
	char peek;
};


